home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / Traps.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  3.2 KB  |  139 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Traps.a
  3. ;
  4. ;    Contains:    A-Trap constants.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__TRAPS__') = 'UNDEFINED' THEN
  18. __TRAPS__ SET 1
  19.  
  20.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  21.     include 'ConditionalMacros.a'
  22.     ENDIF
  23.  
  24.  
  25. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  26. ;
  27. ;         Trap OPWORDS are now defined in each manager    
  28. ;         
  29. ;             Example:
  30. ;            
  31. ;                _GetResource    OPWORD    $A9A0
  32. ;                
  33. ;             is now in the file 'Resources.a'
  34. ;        
  35. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  36.  
  37.  
  38.  
  39. ;    The floating point traps are needed because SANEMacs.a relies on Traps.a
  40. ;    defining them.  We won't be fixing SANEMacs.a, so putting the traps here
  41. ;     allows developers to use Universal AIncludes more easily.
  42. ;
  43.     IF TARGET_CPU_68K THEN
  44.         UnimplementedTrap:    EQU        $A89F
  45.         _Unimplemented:        OPWORD    $A89F
  46.         _FP68K:                OPWORD    $A9EB
  47.         _Elems68K:            OPWORD    $A9EC
  48.         _DecStr68K:            OPWORD    $A9EE
  49.     ENDIF
  50.  
  51.  
  52.  
  53.     IF TARGET_CPU_68K THEN
  54. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  55. ;
  56. ;    MoveTrapWord
  57. ;         
  58. ;     This macro allows OPWORDs to be used as parameters to Get/SetTrapAddress.
  59. ;    For examples:
  60. ;
  61. ;            MoveTrapWord    _GetResource,D0        ; ->    Move.w    #$A9A0,D0
  62. ;            _GetToolboxTrapAddress
  63. ;
  64. ;            MoveTrapWord    $A060,D0            ; ->    Move.w    #$A060,D0
  65. ;            _GetOSTrapAddress
  66. ;        
  67. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  68.     Macro
  69.     MoveTrapWord &trap,&dest=D0
  70.         gbla &trapNum
  71.  
  72.         If &trap = '' then
  73.             AError 'must specify trap number or name'
  74.             Exitm
  75.         Elseif &type(&upcase(&trap)) = 'OPWORD' then
  76.             If &findsym(&sysglobal, &upcase(&trap)) then
  77.                 &trapNum: seta &sysvalue
  78.             Elseif &findsym(&syslocal, &upcase(&trap)) then
  79.                 &trapNum: seta &sysvalue
  80.             Else
  81.                 aerror 'internal error in MoveTrapWord (an OPWORD, but not in any symbol table??)'
  82.                 ExitM
  83.             endif
  84.         Else
  85.             &trapNum: seta &eval(&trap)
  86.         Endif
  87.         If ((&trapNum < 0) or (&trapNum > $3FFC)) and ((&trapNum and $F000) ≠ $A000) then
  88.             AError 'not a valid trap number ($A000 - $AFFF)'
  89.             ExitM
  90.         Endif
  91.         move.w    #&trapNum,&dest
  92.     EndM
  93.     ENDIF    ; TARGET_CPU_68K
  94.  
  95.  
  96.  
  97.  
  98.     IF OLDROUTINENAMES THEN
  99. ;        The following equates are for compatibility with old option bits
  100. ;        
  101. ;            Example:
  102. ;                    _NewPtr, sys        ; old way
  103. ;        
  104. ;        The new way is to use the C name:
  105. ;        
  106. ;            Examle:
  107. ;                    _NewPtrSys            ; new way
  108. ;
  109. ;
  110.  
  111. ;
  112. ; for Device and File Manager routines 
  113. immed                            EQU        $200                ; execute immediately, bypass I/O queue
  114. async                            EQU        $400                ; asynchronous, don't wait for completion
  115. ;
  116. ; for Memory Manager routines 
  117. clear                            EQU        $200
  118. sys                                EQU        $400
  119. ;
  120. ; for string routines 
  121. marks                            EQU        $200                ; set to ignore/strip diacriticals
  122. Case                            EQU        $400                ; set for case sensitivity        
  123. autoPop                            EQU        $400                ; set to pop an extra return address
  124. ;
  125. ; for Get/Set & NGet/NSet TrapAddress 
  126. newTool                            EQU        $600                ; Toolbox trap, under new ordering
  127. newOS                            EQU        $200                ; OS trap, under new ordering
  128. ;
  129. ; for HFS routines 
  130. newHFS                            EQU        $200
  131.  
  132.     ENDIF    ; OLDROUTINENAMES
  133.  
  134.     ENDIF ; __TRAPS__ 
  135.  
  136.